
import {sharedStore} from "./framework/sharedStore.js";
import {switchMode} from "./ux/mode.js";
import {
  sessionStore,
  restoreSessionStore
} from "./framework/sessionStore.js";

let utils = {};

utils.setProjection=(name)=>{
  return sharedStore.save({projection_type: name, orientation: undefined})
}
utils.setMode=(name)=>{
  return switchMode(name)
}
utils.setAnimation=(animation_type)=>{
  return sharedStore.save({animation_type,animation_enabled: true})
}
utils.toggleAnimationEnabled=()=>{
  return sharedStore.toggle("animation_enabled")
}
utils.setZLevel=(z_level)=>{
  return sharedStore.save({z_level})
}
utils.setOverlayType=(overlay_type)=>{
  return sharedStore.save({overlay_type})
}
utils.toggleGrid=()=>{
  return sharedStore.toggle("show_grid_points")
}
utils.toggleHD=()=>{
  return sessionStore.toggle("hd_enabled")
}
export {utils,sharedStore,sessionStore}